package com.health.pay.tencent.business;

import com.health.pay.tencent.common.XMLParser;
import com.health.pay.tencent.protocol.orderquery.OrderQueryReqData;
import com.health.pay.tencent.protocol.orderquery.OrderQueryResData;
import com.health.pay.tencent.service.OrderQueryService;

public class OrderQueryBusiness {

	private OrderQueryService orderQueryService;
	public OrderQueryBusiness() throws IllegalAccessException,
			ClassNotFoundException, InstantiationException {
		orderQueryService = new OrderQueryService();
	}
	
	public OrderQueryResData run(OrderQueryReqData orderQueryReqData)throws Exception {
		
		String orderQueryServiceResponseString;
		String objXmlString=XMLParser.map2XmlString(orderQueryReqData.toMap());
		orderQueryServiceResponseString = orderQueryService
				.request(objXmlString);
		OrderQueryResData orderQueryResData=(OrderQueryResData) XMLParser.getObjectFromXML(orderQueryServiceResponseString,OrderQueryResData.class);
		return orderQueryResData;
	}
}
